<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateShopAddressTable extends Migration
{
    public function up()
    {
        Schema::create('shop_address', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('user_id')->comment('用户ID');
            $table->string('country',4)->comment('国家');
            $table->string('province',4)->comment('省');
            $table->string('city',4)->comment('市');
            $table->string('area',6)->comment('区');
            $table->string('detail')->comment('详细地址');
            $table->string('code',6)->default(0)->comment('邮编');
            $table->string('full_name')->comment('区域全称');
            $table->string('name',50)->comment('收件人');
            $table->string('phone',11)->comment('手机');
            $table->boolean('default')->default(false)->comment('默认地址');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('shop_address');
    }
}
